package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.map.HLMKMap;

public class HLClassMKMap extends HLLibClass {
    public HLClassMKMap(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLMKMap();
    }

    public void Execute(HLObject self, int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            ((HLMKMap) self).InitByRectAndCenterAndZoom(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3), args.GetInt(4), args.GetInt(5), args.GetInt(6));
            break;
        }
        case 1: {
            ((HLMKMap) self).SetCenter(args.GetInt(0), args.GetInt(1));
            break;
        }
        case 2: {
            ((HLMKMap) self).SetZoom(args.GetInt(0));
            break;
        }
        case 3: {
            ((HLMKMap) self).SetZoomAtCentre(args.GetInt(0), args.GetInt(1), args.GetInt(2));
            break;
        }
        case 4: {
            ((HLMKMap) self).SetZoomAtCentreBySize(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3));
            break;
        }
        case 5: {
            ((HLMKMap) self).SetMove(args.GetInt(0), args.GetInt(1));
            break;
        }
        case 6: {
            if (resultOwnerObject == null) {
                ((HLMKMap) self).GetPoint(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLMKMap) self).GetPoint(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 7: {
            if (resultOwnerObject == null) {
                ((HLMKMap) self).GetCoordinate(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLMKMap) self).GetCoordinate(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 8: {
            ((HLMKMap) self).SetMapType(args.GetInt(0));
            break;
        }
        case 9: {
            ((HLMKMap) self).SetVisiable(args.GetBoolean(0));
            break;
        }
        case 10: {
            if (resultOwnerObject == null) {
                ((HLMKMap) self).GetUserLocation();
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLMKMap) self).GetUserLocation());
            }
            break;
        }
        case 11: {
            ((HLMKMap) self).UserInteractionEnabled(args.GetBoolean(0));
            break;
        }
        case 12: {
            ((HLMKMap) self).Update();
            break;
        }
        }
    }

    public void StaticExecute(int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            if (resultOwnerObject == null) {
                HLMKMap.GetDistanse(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMKMap.GetDistanse(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3)));
            }
            break;
        }
        }
    }
}
